Integrand size = 38, antiderivative size = 101 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=-\frac {(a B+b C) x}{a^2+b^2}-\frac {(b B-a C) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a^2 (b B-a C) \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {C \tan (c+d x)}{b d} \]
[Out]
Time = 0.31 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3713, 3687, 3707, 3698, 31, 3556} \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=\frac {a^2 (b B-a C) \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}-\frac {(b B-a C) \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {x (a B+b C)}{a^2+b^2}+\frac {C \tan (c+d x)}{b d} \]
[In]
[Out]
Rule 31
Rule 3556
Rule 3687
Rule 3698
Rule 3707
Rule 3713
Rubi steps \begin{align*} \text {integral}& = \int \frac {\tan ^2(c+d x) (B+C \tan (c+d x))}{a+b \tan (c+d x)} \, dx \\ & = \frac {C \tan (c+d x)}{b d}+\frac {\int \frac {-a C-b C \tan (c+d x)+(b B-a C) \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b} \\ & = -\frac {(a B+b C) x}{a^2+b^2}+\frac {C \tan (c+d x)}{b d}+\frac {(b B-a C) \int \tan (c+d x) \, dx}{a^2+b^2}+\frac {\left (a^2 (b B-a C)\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )} \\ & = -\frac {(a B+b C) x}{a^2+b^2}-\frac {(b B-a C) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {C \tan (c+d x)}{b d}+\frac {\left (a^2 (b B-a C)\right ) \text {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^2 \left (a^2+b^2\right ) d} \\ & = -\frac {(a B+b C) x}{a^2+b^2}-\frac {(b B-a C) \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {a^2 (b B-a C) \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {C \tan (c+d x)}{b d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.66 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.17 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=\frac {\frac {i (B+i C) \log (i-\tan (c+d x))}{a+i b}-\frac {(i B+C) \log (i+\tan (c+d x))}{a-i b}+\frac {2 a^2 (b B-a C) \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right )}+\frac {2 C \tan (c+d x)}{b}}{2 d} \]
[In]
[Out]
Time = 0.13 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (d x +c \right ) C}{b}+\frac {\frac {\left (B b -C a \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-B a -C b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {a^{2} \left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{d}\) | \(101\) |
default | \(\frac {\frac {\tan \left (d x +c \right ) C}{b}+\frac {\frac {\left (B b -C a \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2}+\left (-B a -C b \right ) \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {a^{2} \left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{d}\) | \(101\) |
norman | \(\frac {C \tan \left (d x +c \right )}{b d}-\frac {\left (B a +C b \right ) x}{a^{2}+b^{2}}+\frac {a^{2} \left (B b -C a \right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right ) d}+\frac {\left (B b -C a \right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d \left (a^{2}+b^{2}\right )}\) | \(106\) |
parallelrisch | \(\frac {-2 B a \,b^{2} d x -2 C \,b^{3} d x +B \ln \left (1+\tan \left (d x +c \right )^{2}\right ) b^{3}+2 B \ln \left (a +b \tan \left (d x +c \right )\right ) a^{2} b -C \ln \left (1+\tan \left (d x +c \right )^{2}\right ) a \,b^{2}-2 C \ln \left (a +b \tan \left (d x +c \right )\right ) a^{3}+2 C \,a^{2} b \tan \left (d x +c \right )+2 C \,b^{3} \tan \left (d x +c \right )}{2 d \left (a^{2}+b^{2}\right ) b^{2}}\) | \(130\) |
risch | \(\frac {x B}{i b -a}-\frac {i x C}{i b -a}-\frac {2 i a^{2} B x}{b \left (a^{2}+b^{2}\right )}-\frac {2 i a^{2} B c}{b d \left (a^{2}+b^{2}\right )}+\frac {2 i a^{3} C x}{b^{2} \left (a^{2}+b^{2}\right )}+\frac {2 i a^{3} C c}{b^{2} d \left (a^{2}+b^{2}\right )}+\frac {2 i B x}{b}+\frac {2 i B c}{b d}-\frac {2 i C a x}{b^{2}}-\frac {2 i C a c}{b^{2} d}+\frac {2 i C}{b d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) B}{b d \left (a^{2}+b^{2}\right )}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right ) C}{b^{2} d \left (a^{2}+b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B}{b d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) C a}{b^{2} d}\) | \(320\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.48 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=-\frac {2 \, {\left (B a b^{2} + C b^{3}\right )} d x + {\left (C a^{3} - B a^{2} b\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - {\left (C a^{3} - B a^{2} b + C a b^{2} - B b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 2 \, {\left (C a^{2} b + C b^{3}\right )} \tan \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} d} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.67 (sec) , antiderivative size = 1020, normalized size of antiderivative = 10.10 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.08 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=-\frac {\frac {2 \, {\left (B a + C b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (C a^{3} - B a^{2} b\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b^{2} + b^{4}} + \frac {{\left (C a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, C \tan \left (d x + c\right )}{b}}{2 \, d} \]
[In]
[Out]
none
Time = 0.49 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.09 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=-\frac {\frac {2 \, {\left (B a + C b\right )} {\left (d x + c\right )}}{a^{2} + b^{2}} + \frac {{\left (C a - B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, {\left (C a^{3} - B a^{2} b\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{2} + b^{4}} - \frac {2 \, C \tan \left (d x + c\right )}{b}}{2 \, d} \]
[In]
[Out]
Time = 8.25 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.16 \[ \int \frac {\tan (c+d x) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx=\frac {C\,\mathrm {tan}\left (c+d\,x\right )}{b\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B-C\,1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (C\,a^3-B\,a^2\,b\right )}{d\,\left (a^2\,b^2+b^4\right )}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-C+B\,1{}\mathrm {i}\right )}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \]
[In]
[Out]